﻿<%@ Page Title="" Language="C#" MasterPageFile="~/whatsnew/WhatsNewMasterPage.Master" AutoEventWireup="true" CodeBehind="event_view.aspx.cs" Inherits="Com.Web.coffinegurunaru.whatsnew.event_view" %>
<%@ Register TagPrefix="UC" TagName="Paging" Src="~/whatsnew/usercontrol/paging.ascx" %>
<%@ Import Namespace="Com.Library.DB.Event" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="33">&nbsp;</td>
          </tr>
          <tr>
            <td><img src="/images/whatsnew/tit_01.gif" width="457" height="48"></td>
          </tr>
          <tr>
            <td height="30">&nbsp;</td>
          </tr>
          <tr>
            <td align="center"><table width="98%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="28"><%= EventInfo.Title %></td>
                <td align="right">date : <%= EventInfo.EventStart %>~<%= EventInfo.EventEnd %></td>
              </tr>
            </table>
              <table border='1' cellpadding='0' cellspacing='0' width='98%' style='border-collapse:collapse' bordercolor='#dedede' frame='void'>
              <tr>
                <td align="center" bgcolor='#dedede'></td>
              </tr>
              <tr>
                <td align="center" style="padding:20px">
                <% if ( EventInfo.BigImageUrl != string.Empty ) { %><img src="<%= EventInfo.BigImageUrl %>" width="596" ><br /><% } %>
                <% if ( EventInfo.BigImageUrl2 != string.Empty ) { %><img src="<%= EventInfo.BigImageUrl2 %>" width="596" ><br /><% } %>
                <% if ( EventInfo.BigImageUrl3 != string.Empty ) { %><img src="<%= EventInfo.BigImageUrl3 %>" width="596" ><br /><% } %>
                <% if ( EventInfo.BigImageUrl4 != string.Empty ) { %><img src="<%= EventInfo.BigImageUrl4 %>" width="596" ><br /><% } %>
                <% if ( EventInfo.BigImageUrl5 != string.Empty ) { %><img src="<%= EventInfo.BigImageUrl5 %>" width="596" ><br /><% } %>
                <% if ( EventInfo.BigImageUrl6 != string.Empty ) { %><img src="<%= EventInfo.BigImageUrl6 %>" width="596" ><br /><% } %>
                <% if ( EventInfo.BigImageUrl7 != string.Empty ) { %><img src="<%= EventInfo.BigImageUrl7 %>" width="596" ><br /><% } %>
                <% if ( EventInfo.BigImageUrl8 != string.Empty ) { %><img src="<%= EventInfo.BigImageUrl8 %>" width="596" ><br /><% } %>
                <% if ( EventInfo.BigImageUrl9 != string.Empty ) { %><img src="<%= EventInfo.BigImageUrl9 %>" width="596" ><br /><% } %>
                <% if ( EventInfo.BigImageUrl10 != string.Empty ) { %><img src="<%= EventInfo.BigImageUrl10 %>" width="596" ><br /><% } %>
                </td>
              </tr>
              <tr>
				<td <%=GetContentAlign(EventInfo.CodeContent) %>><br />
					<%= Server.HtmlEncode(EventInfo.Content).Replace("\n", "<br/>")%>
				<br /><br /><br /></td>
            </tr>
              <tr>
                <td height="70" align="center">
                
                 <table width="98%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td height="50" align="center">
					<% if (EventMoveInfo.EventSN_Prev != 0) { %><a href="event_view.aspx?eventsn=<%= EventMoveInfo.EventSN_Prev %>&pageno=<%= PageNo %>"><img src="/images/whatsnew/bt_prv.jpg" width="54" height="26"></a>&nbsp;<% } %>
					<a href="event.aspx?pageno=<%= PageNo %>"><img src="/images/whatsnew/bt_list.jpg" width="72" height="26"></a> 
					<% if (EventMoveInfo.EventSN_Next != 0) { %>&nbsp;<a href="event_view.aspx?eventsn=<%= EventMoveInfo.EventSN_Next %>&pageno=<%= PageNo %>"><img src="/images/whatsnew/bt_next.jpg" width="54" height="26"></a><% } %>
				  </td>
                </tr>
              </table>
              
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td height="10" colspan="3">&nbsp;</td>
                  </tr>
                  <tr>
                    <td height="10" colspan="3" align="center"><textarea name="CommentContent" cols="85" rows="3" class="minput_gray" id="CommentContent"></textarea>
                      <a href="#" id="m_btnComment"><img src="/images/whatsnew/bt_reply.jpg" width="63" height="45" align="absmiddle"></a></td>
                  </tr>
                  <tr>
                      <td height="10" colspan="3">&nbsp;</td>
                    </tr>
<%	if ( EventCommentList.Count == 0 ) { %>
					<tr>
                      <td height="10" colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td align="center">등록된 댓글이 없습니다.</td>
                        </tr>
                      </table></td>
                    </tr>
<%	} else { %>
<%		for(int i = 0; i < EventCommentList.Count; i ++ ) { %>
<%			if ( i  != 0 ) { %>
					<tr>
                      <td height="10" colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td background="/images/common/gray_dot.gif"><img src="/images/common/gray_dot.gif" alt="" width="3" height="1"></td>
                        </tr>
                      </table></td>
                    </tr>
<%			} %>
                    <tr>
                      <td width="100" height="25" class="m_CommendUserID"><span class="gray_bold"><img src="/images/common/icon_gray.gif" alt="" width="6" height="6" align="absmiddle"></span> <%=EventCommentList[i].UserID %></td>
                      <td class="m_tdCommentContent">
						<span class="m_CommentContent"><%=EventCommentList[i].Comment.HTMLEncode() %></span>
                      <% if ( this.WebCookies.UserNo == EventCommentList[i].UserNo ) { %>
						<span class="m_Modify" style="display:none;">
							<textarea name="txtComment_<%=EventCommentList[i].EventCommentSN %>" cols="70" rows="3" class="minput_gray" id="txtCommend_<%=EventCommentList[i].EventCommentSN %>"><%=EventCommentList[i].Comment.HTMLEncode() %></textarea>
							<a href="#" onclick="CommendModifyConfirm(this, <%=EventCommentList[i].EventCommentSN %>); return false;"><img src="/images/whatsnew/bt_reply.jpg" width="63" height="45" align="absmiddle"></a>
						</span>
				      <% } %>
                      </td>
                      <td align="right" class="m_CommentDate" style="width:85px;"><span class="gray_sbold"><%=EventCommentList[i].CreateDate.ToString("yyyy-MM-dd")%> 
                      <% if ( this.WebCookies.UserNo == EventCommentList[i].UserNo ) { %>
						<a href="#" onclick="CommendModifyView(this, <%=EventCommentList[i].EventCommentSN %>); return false;"><img src="/images/common/bt_modi.gif" width="12" height="12" align="absmiddle"></a>
						<a href="#" onclick="CommentRemove(<%=EventCommentList[i].EventCommentSN %>); return false;"><img src="/images/common/bt_del.gif" width="12" height="12" align="absmiddle"></a>
					  <% } %></span></td>
                    </tr>

<%		} %>
<%	} %>
                    <tr>
                      <td height="10" colspan="3">&nbsp;</td>
                    </tr>
              </table></td>
              </tr>
              <tr>
                <td height='1' bgcolor='#dedede'></td>
              </tr>
            </table>
              <table width="98%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="center"><UC:Paging ID="UC_Paging" runat="server" /></td>
                </tr>
              </table>
          </td>
          </tr>
        </table>
<% if ( this.WebCookies.IsLogin ) { %>
<script language="javascript" type="text/javascript">
(function() {
	$(function() {
		$("#m_btnComment").click(function() {
			var CommentConetnt = $("#CommentContent").val();
			
			if ( $.trim(CommentConetnt) == "" ) {
				alert( "댓글 내용을 입력해주세요" );
				return false;
			}
			$("form:eq(0)").submit();
		});
	});
})(jQuery);
</script>
<% } else { %>
<script language="javascript" type="text/javascript">
(function() {
	$(function() {
		$("#m_btnComment").click(function() {
			if ( confirm( "로그인 하셔야 이용가능합니다.\n 로그인 하시겠습니까?") ) {
				location.href = "/login/login.aspx";
			}
			return false;
		});
	});
})(jQuery);
</script>
<% } %>
<script language="javascript" type="text/javascript">
function CommentRemove(EventCommentSN) {
	if ( confirm("정말로 삭제하시겠습니까?" ) )
	{
		jQuery("#EventCommentSN").val(EventCommentSN);
		jQuery("#EventType").val("remove");
		jQuery("form:eq(0)").submit();
		
	}
}

function CommendModifyView(obj, EventCommentSN) {
	var $tr = $(obj).closest("tr");
	$tr.find("span.m_Modify").show();
	$tr.find("span.m_CommentContent").hide();
	$tr.find("td.m_CommentDate").hide();
	$tr.find("td.m_tdCommentContent").attr("colspan", 2);
}

function CommendModifyConfirm(obj, EventCommentSN) {
	jQuery("#EventCommentSN").val(EventCommentSN);
	jQuery("#EventType").val("modify");
	jQuery("form:eq(0)").submit();
}
</script>
<input type="hidden" value="" id="EventCommentSN" name="EventCommentSN" />
<input type="hidden" value="" id="EventType" name="EventType" />
</asp:Content>
